package com.kexio.pay.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 微信支付配置属性
 * 
 * 配置文件: application-pay.yml
 * 
 * @author Kexio Team
 */
@Component
@ConfigurationProperties(prefix = "wxpay")
public class WxPayProperties {
    
    /**
     * 应用ID
     */
    private String appId;
    
    /**
     * 商户号
     */
    private String mchId;
    
    /**
     * API密钥（V2）
     */
    private String apiKey;
    
    /**
     * API V3密钥
     */
    private String apiV3Key;
    
    /**
     * 商户私钥（证书模式）
     */
    private String privateKey;
    
    /**
     * 商户证书序列号
     */
    private String serialNo;
    
    /**
     * 微信支付证书路径（apiclient_cert.p12）
     */
    private String certPath;
    
    /**
     * 外网访问域名（用于回调）
     */
    private String domain;
    
    /**
     * API版本（V2/V3）
     */
    private String apiVersion = "V2";

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getMchId() {
        return mchId;
    }

    public void setMchId(String mchId) {
        this.mchId = mchId;
    }

    public String getApiKey() {
        return apiKey;
    }

    public void setApiKey(String apiKey) {
        this.apiKey = apiKey;
    }

    public String getApiV3Key() {
        return apiV3Key;
    }

    public void setApiV3Key(String apiV3Key) {
        this.apiV3Key = apiV3Key;
    }

    public String getPrivateKey() {
        return privateKey;
    }

    public void setPrivateKey(String privateKey) {
        this.privateKey = privateKey;
    }

    public String getSerialNo() {
        return serialNo;
    }

    public void setSerialNo(String serialNo) {
        this.serialNo = serialNo;
    }

    public String getCertPath() {
        return certPath;
    }

    public void setCertPath(String certPath) {
        this.certPath = certPath;
    }

    public String getDomain() {
        return domain;
    }

    public void setDomain(String domain) {
        this.domain = domain;
    }

    public String getApiVersion() {
        return apiVersion;
    }

    public void setApiVersion(String apiVersion) {
        this.apiVersion = apiVersion;
    }

    @Override
    public String toString() {
        return "WxPayProperties{" +
                "appId='" + appId + '\'' +
                ", mchId='" + mchId + '\'' +
                ", apiVersion='" + apiVersion + '\'' +
                ", domain='" + domain + '\'' +
                '}';
    }
}

